package test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;

public class test {
	@Test
	public void generator() throws Exception{
		List<String> warnings = new ArrayList<>();
		boolean overWrite = true;
		File configFile = new File("generator.xml");
		ConfigurationParser cp = new ConfigurationParser(warnings);
		Configuration config = cp.parseConfiguration(configFile);
		DefaultShellCallback dsc = new DefaultShellCallback(overWrite);
		MyBatisGenerator mg = new MyBatisGenerator(config, dsc, warnings);
		mg.generate(null);
	}

}
